<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义指令</title>
    <!-- 引入vue -->
    <script type="text/javascript" src="../js/vue.js"></script>
</head>

<body>
    <!-- 准备好一个容器 -->
    <div id="root">
        <h2>当前的n值是: <span v-text="n"></span></h2>
        <h2>方法10倍后的n值是: <span v-big="n"></span></h2>
        <button @click="n++">点击n+1</button>
    </div>

    <script>
        new Vue({
            el: '#root',
            data: {
                n: 1
            },
            directives: {
                big: {}
            }
        })
    </script>

</body>

</html>